package com.woniuedu.search.entity;



import java.io.Serializable;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * <p>
 *
 * </p>
 *
 * @author yuankaiqiang
 * @since 2022-04-20
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "article")
@Builder
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @Field(name="id", type = FieldType.Keyword)
    @ApiModelProperty(value = "文章id")
    private String id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    @ApiModelProperty(value = "标题")
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    @ApiModelProperty(value = "文章内容")
    private String context;

    @Field
    @ApiModelProperty(value = "封面url")
    private String cover;

    @Field(value = "editor_type")
    @ApiModelProperty(value = "编辑器类型，0为md编辑器、1为富文本编辑器")
    private Integer editorType;

    @Field(value = "lable_ids")
    @ApiModelProperty(value = "标签的ids")
    private String lableIds;

    @Field
    @ApiModelProperty(value = "摘要")
    private String summary;

    @Field(value = "class_ids")
    @ApiModelProperty(value = "分类的id")
    private String classIds;

    @Field
    @ApiModelProperty(value = "文章类型")
    private String type;

    @Field(value = "release_form")
    @ApiModelProperty(value = "发布形式")
    private String releaseForm;

    @Field(value = "is_delete")
    @ApiModelProperty(value = "是否删除")
    private Integer isDelete;


}
